package loteriamais.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class ConvertPasswordToMD5 {

	public static String converSenhaMD5(String password) {
		BigInteger hash = null;
		try {
			MessageDigest md = MessageDigest.getInstance("MD5");
			hash = new BigInteger(1, md.digest(password.getBytes()));
		} catch(NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return String.format("%32x", hash);
	}
}
